package slevnik;

import java.util.List;

/**
 * This class is an interface to manager of categories
 * @author Eduard Krak, Martin Penak
 */
public interface CategoryManager {

     /**
     * This method adds given category to categories table. Works with SQL.
     * @param category to be added
     * @return Category, which was added.
     * @throws SlevnikException
     */
    public Category addCategory(Category category)throws SlevnikException;

    /**
     * This method removes given category from categories table. Returns true if
     * category was in the categories table and has been removed,
     * false if item hasn't been found.
     * @param category to be removed
     * @return True if category was found and removed, false otherwise.
     * @throws SlevnikException
     */
    public boolean removeCategory(Category category) throws SlevnikException;

    /**
     * This method finds all categories in database
     * @return list of all categories
     * @throws SlevnikException
     */
    public List<Category> findAllCategories() throws SlevnikException;

    /**
     * This method finds category with given id
     * false if item hasn't been found.
     * @param id id of finding category
     * @return category with given id
     * @throws SlevnikException
     */
    public Category findCategoryById(int id) throws SlevnikException;
    /**
     * This method removes all categories from categories table, so the table is empty.
     * @return True if categories have been removed, false otherwise.
     * @throws SlevnikException
     */
    public boolean removeAllCategories() throws SlevnikException;

}
